from datetime import datetime
import random

random.seed(42)
# 数据库配置
host = "localhost"
user = "root"
password = "louis.20020120"
database = "supermarket_inventory_management"

# 数据库的常量
min_left_quality_days = 1  # 保质期剩余min_left_quality_days天时，就提醒需要下架或者从仓库移除
now_date = '2022-04-24'

# 常量
date_format = "%Y-%m-%d"
date_time_format = "%Y-%m-%d %H:%M:%S"

# 自动产生数据
warehouse_nums = 500
shelves_nums = 150
employee_nums = 200
goods_nums = 2000
launch_nums = 200
off_nums = 100
sales_nums = 150
pay_account_nums = 1000
manages_nums = 100
Wstreets = {'南岗区': ['西大直街', '和兴路', '东大直街'],
            '道里区': ['保健路', '三合路', '宋海路'],
            '道外区': ['牛牛路', '猪猪路', '羊羊路'],
            '香坊区': ['狗狗路', '马马路', '蛇蛇路'],
            '松北区': ['大大路', '小小路', '中中路']}
Wdistricts = list(Wstreets.keys())
Max_house_numbers = 100  # 最大门牌号数
Sdistricts = ['东北', '东', '东南', '南', '西南', '西', '西北', '北']
sexes = ['M', 'F']

Birthdays_start = '1990-01-20'
Birthdays_max_days = 1000  # 生日最多相差多少天
Birthdays = [
    datetime.utcfromtimestamp((datetime.fromisoformat(Birthdays_start).timestamp() - i * 86400.0)).strftime(
        "%Y-%m-%d") for i in range(Birthdays_max_days)]

max_phonenumbers_num = 3  # 每个人最多拥有的电话号码
max_phonenumbers_num_base = 100000  # 共100000个电话号码
Phonenumbers = ['{}'.format(random.randint(10000000000, 99999999999)) for _ in range(max_phonenumbers_num_base)]  # 电话号码
selected_phonenumbers = set()

Manufacture_max_days = 1000  # 生产日期最多相差多少天
Manufacture_dates = [
    datetime.utcfromtimestamp((datetime.fromisoformat(now_date).timestamp() - i * 86400.0)).strftime(
        "%Y-%m-%d") for i in range(Manufacture_max_days)]

max_Quality_days = 1500  # 保质期最大天数
Manufacturers_num = 100
Units = ['个', 'g']
max_Pnumber = 1000
Pay_modes = ['Wechat', 'Alipay', 'Credit', 'Cash']
max_shelf_days = 1000  # 最大上架天数

Appointment_max_days = 1000  # 上任日期最多相差多少天
Appointment_dates = [
    datetime.utcfromtimestamp((datetime.fromisoformat(now_date).timestamp() - i * 86400.0)).strftime(
        "%Y-%m-%d") for i in range(Appointment_max_days)]
max_profit_margin = 0.5  # 利润率
